package jco3.sessionManagement_JCoContext;

import com.sap.conn.jco.JCoDestination;
import com.sap.conn.jco.JCoException;
import com.sap.conn.jco.JCoFunction;

public class RfcFunctions {
	public static int runGetCounter(JCoDestination dest) throws JCoException{
		JCoFunction counterFM = dest.getRepository().getFunction("GET_COUNTER");
		counterFM.execute(dest);
		int count = (int) counterFM.getExportParameterList().getValue("GET_VALUE");
		return count;
	}
	
	public static void runIncrement(JCoDestination dest) throws JCoException{
		JCoFunction increment = dest.getRepository().getFunction("INCREMENT_COUNTER");
		increment.execute(dest);
	}
}
